package com.briup.day28;
/**
 * 获取类镜像的三种方法
 * */
public class ReflectionDemo1 {

	public static void main(String[] args) throws Exception {
		// 1.Class.forName()
		Class cls1 = Class.forName("com.briup.day28.Student");
		System.out.println(cls1);
		
		//2.类名.class
		Class cls2 = Student.class;
		
		//3.对象.getClass()
		Student student = new Student();
		Class cls3 = student.getClass();
		
		//判断对象是否为同一个
		System.out.println(cls2 == cls1);
		System.out.println(cls3 == cls2);
		System.out.println(System.identityHashCode(cls1));
		System.out.println(cls2.hashCode());
		

	}

}
